package com.ifox.hgx.spring.factory;

import com.ifox.hgx.spring.bean.Car;

import java.util.HashMap;
import java.util.Map;

/**
 * Copyright (C), 2017-2018, 成都艾弗克斯科技有限公司
 * Author:   hanguixian
 * Date:     2018/10/21 11:22
 * Description:
 */
public class CarInstanceFactory {
    private Map<Integer,Car> cars ;

    public CarInstanceFactory() {
        cars = new HashMap<>() ;
        cars.put(1, new Car(1, "大奔"));
        cars.put(2, new Car(2, "劳斯莱斯"));
    }

    public Car getCar(Integer id){
        return cars.get(id) ;
    }
}
